//youzhengbianma
function aaa() {
    var price=$("#surPostalcode").val();
    var reg=/^[0-9]{6}$/;
    var flag=reg.test(price);
    if(flag){

    }else{
        alert("邮政编码是6位数字");

    }
    return flag
}
//法人身份证
function bbb() {
    var price=$("#surPostalcode").val();
    var reg=/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;
    var flag=reg.test(price);
    if(flag){
    }else{
        alert("请输入正确的身份证号");

    }
    return flag
}
//email;
function ccc() {
    var price=$("#surEmail").val();
    var reg=/^\w+@[a-zA-Z0-9]{2,10}(?:\.[a-z]{2,4}){1,3}$/;
    var flag=reg.test(price);
    if(flag){

    }else{
        alert("请输入正确邮箱");

    }
    return flag
}
//新增
//供货商名字
function eee() {
    var val = $("#name1").val();
    $.ajax({
        url:"/myspringboot/findsuppliername",
        data:{surName:val},
        type:"post",
        dataType:"json",
        success :function (result) {
            var code = result.code;
            var msg = result.msg;
            if (code==0){
                alert(msg)
            }else {
            }

        }
    })
}
//邮政编码
function code1() {
    var price=$("#code").val();
    var reg=/^[0-9]{6}$/;
    var flag=reg.test(price);
    if(flag){

    }else{
        alert("邮政编码是6位数字");

    }
    return flag
}
//法人身份证
function card1() {
    var price=$("#card").val();
    var reg=/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;
    var flag=reg.test(price);
    if(flag){
    }else{
        alert("请输入正确的身份证号");

    }
    return flag
}
//电子邮箱
function email2() {
    var price=$("#email1").val();
    var reg=/^\w+@[a-zA-Z0-9]{2,10}(?:\.[a-z]{2,4}){1,3}$/;
    var flag=reg.test(price);
    if(flag){

    }else{
        alert("请输入正确邮箱");

    }
    return flag
}

//修改
//供货商名字
function yyy() {
    var val = $("#name").val();
    $.ajax({
        url:"/myspringboot/findsuppliername",
        data:{surName:val},
        type:"post",
        dataType:"json",
        success :function (result) {
            var code = result.code;
            var msg = result.msg;
            if (code==0){
                alert(msg)
            }else {
            }

        }
    })
}
//邮政编码
function code2() {
    var price=$("#postalcode").val();
    var reg=/^[0-9]{6}$/;
    var flag=reg.test(price);
    if(flag){

    }else{
        alert("邮政编码是6位数字");

    }
    return flag
}
//法人身份证
function card2() {
    var price=$("#legalpersonIdcard").val();
    var reg=/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;
    var flag=reg.test(price);
    if(flag){
    }else{
        alert("请输入正确的身份证号");

    }
    return flag
}
//电子邮箱
function email3() {
    var price = $("#email").val();
    var reg = /^\w+@[a-zA-Z0-9]{2,10}(?:\.[a-z]{2,4}){1,3}$/;
    var flag = reg.test(price);
    if (flag) {

    }else {
        alert("请输入正确的邮箱")
    }
     return flag;
}